﻿<UserControl
    x:Class="MDrive.Views.MDriveParameterView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    mc:Ignorable="d"
    Height="120"
    Width="300">
    <Border
        BorderBrush="Gray"
        BorderThickness="10"
        CornerRadius="10"
        Margin="5">
        <Grid
            Margin="5">
            <Grid.RowDefinitions>
                <RowDefinition
                    Height="auto" />
                <RowDefinition
                    Height="*" />
            </Grid.RowDefinitions>
            <TextBlock
                Foreground="White"
                FontWeight="Bold"
                FontSize="15"
                TextAlignment="Center">
                <Run
                    Text="{Binding Symbol}" />
                <Run
                    Text=": " />
                <Run
                    Text="{Binding Label}" /></TextBlock>
            <Grid
                Grid.Row="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition
                        Width="*" />
                    <ColumnDefinition
                        Width="auto" />
                </Grid.ColumnDefinitions>
                <TextBox
                    x:Name="ReadValueTextBox"
                    GotFocus="OnReadValueGotFocus"
                    TextAlignment="Center"
                    Text="{Binding ReadValue, Mode=TwoWay}" />
                <TextBox
                    x:Name="SendValueTextBox"
                    LostFocus="OnSendValueLostFocus"
                    TextAlignment="Center"
                    Foreground="Green"
                    FontSize="40"
                    Text="{Binding SendValue, Mode=TwoWay}" />
                <ToggleButton
                    x:Name="SendRequestToggleButton"
                    IsChecked="{Binding SendRequest, Mode=TwoWay}"
                    Grid.Column="2"
                    Width="60" />
            </Grid>
        </Grid>
    </Border>
</UserControl>
